package com.dfbz.demo_第七题;

import java.util.Properties;
import java.util.Set;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01_Properties的基本用法 {

    public static void main(String[] args) {

        Properties prop = new Properties();

        prop.setProperty("username","root");
        prop.setProperty("password","123");
        prop.setProperty("email","root@admin.com");

        System.out.println(prop);
        System.out.println("----------------");

        Set<String> keys = prop.stringPropertyNames();
        for (String key : keys) {
            System.out.println(key);
        }

        System.out.println("----------------");
        System.out.println(prop.getProperty("username"));           // root
        System.out.println(prop.getProperty("password"));           // 123
    }
}
